#ifndef DATAWIDGET_H
#define DATAWIDGET_H

#include "models/command.h"
#include <QWidget>
#include <QTableWidget>
#include <QJsonObject>
#include <QResizeEvent>

class DataWidget : public QWidget
{
    Q_OBJECT

public:
    DataWidget(QWidget *parent = nullptr);
    void setupUI();
    void setJointType(JointType tempJointType);
    void setColor(QString background,QString border);
    void updateData();
private:
    QString backgroundColor="#2E2F31";
    QString borderColor="#3E3E40";
    QTableWidget *table=nullptr;
    JointType curJointType=HEAD_JOINT;
    QStringList m_labels = {"位姿", "速度", "力矩","温度","状态","错误码"};
    bool m_bFirst=true;
protected:
    void showEvent(QShowEvent *event);
};

#endif // DATAWIDGET_H
